#include using std::cin; using std::cout; using std::endl; void main() { char s[1000]; cin.getline(s,1000); char token[1000]; int tokenIndex = 0; char result[1000] = ""; for(int i = 0; i <= strlen(s); i++) { if(s[i] == ',' || s[i] == '\0') { cout << token << endl; //translate token to pig latin (if this were a pig latin program) strcat(result, token); strcat(result, " "); tokenIndex = 0; } else { token[tokenIndex] = s[i]; tokenIndex++; token[tokenIndex] = '\0'; } } }